package com.sservice.web.controller.admin;

import com.sservice.base.entity.dto.ListResult;
import com.sservice.base.entity.dto.Pagination;
import com.sservice.service.service.ISysLogService;
import com.sservice.urp.vo.SysLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by suweiming on 2017/12/20.
 */

@Controller
@RequestMapping("/admin/sysLog")
public class SysLogController {
    @Autowired
    private ISysLogService service;

    /***
     * 日志查询
     * @param arg
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/query", method = RequestMethod.GET)
    public ListResult queryLog(SysLogVo arg) {
        List<SysLogVo> list_order = service.queryByPage(arg);
        int total = service.queryByCount(arg);
        Pagination page = new Pagination(arg.getPage(), total, arg.getSize());
        ListResult res = new ListResult(true, list_order);
        res.setPage(page);
        return res;
    }
}
